package logic

import (
	"express/handler/request"
	"express/model"
)

func GetUserAll(userId string) interface{} {
	b := model.Users{}
	return b.GetAllUsers(userId)
}

func GetTodayNumberLogic(userId string, userqu request.UsersRequest, page int, pageSize int) interface{} {
	//var res int
	//res = 1
	//var Express []model.Express
	//a := &request.UsersRequest{}
	c := model.ExpressNumber{}
	//等价于：SELECT * FROM `foods`
	//设置查询的时间
	var dateStart string = userqu.Date + " 00:00:00"
	var dateEnd string = userqu.Date + " 23:59:59"
	list := c.GetDateNumber(dateStart, dateEnd, userId, page, pageSize)

	return list
}

func SetNumberLogic(userId int, number string) (no bool) {
	no = true
	num := &model.ExpressNumber{
		UserId: userId,
		Number: number,
	}
	num.Create()
	return
}
